import React, { useEffect, useContext} from "react";
import { useLocation, Outlet } from "react-router";
import { AuthContext } from "../../contexts/authContext"

import { Articles } from "../../components/Articles/Articles";
export const Recommend = () => {
  const { pathname } = useLocation()
  const { state, dispatch } = useContext(AuthContext)
  useEffect(() => {
    dispatch({ category_id: state.category_id })
  }, [])
  return (
    <div>
      {
        pathname == "/recommend" ? <Articles /> : <Outlet />
      }
    </div>
  )
}

